package com.jt.controller.pojo;

import com.jt.controller.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/user")
@RestController//@Controller+@ResponseBody
public class UserController {
    @RequestMapping("/findUser2")
    public String findUser2(Integer id,String name,int age){
        return id+name+age;
    }
    @RequestMapping("/findUser3")
    public User findUser3(User user){
        user.setA(123);
        user.setB("456");
        return user;
    }
//    @RequestMapping("/restFul/{id}/{name}")
//    public User restFul(@PathVariable Integer id, @PathVariable String name){
//        User user = new User();
//        user.setA(id);
//        user.setB(name);
//        return user;
//    }
//    @RequestMapping("/restFul/{id}/{name}")
    @GetMapping("/restFul/{id}/{name}")
    public User restFul(User user){
        return user;
    }
}
